import ajax from './index'

export function alibaba_group() {
    return ajax({
        url: "/backend/alibaba/groups",
        method: "get"
    });
}

export function alibaba_group_sync() {
    return ajax({
        url: "/backend/alibaba/group_sync",
        method: "post",
    });
}

export function alibaba_goods_list(group_id, condition) {
    if(!condition) {
        condition = {
            page: 1,
            num: 100
        }
    }
    return ajax({
        url: "/backend/alibaba/list/" + (group_id || 0),
        method: "get",
        params: condition
    });
}

export function alibaba_goods_sync(group_id) {
    return ajax({
        url: "/backend/alibaba/goods_sync/" + group_id,
        method: "post",
    });
}

export function alibaba_goods_detail_sync(goods_id) {
    return ajax({
        url: "/backend/alibaba/goods_detail_sync/" + goods_id,
        method: "post",
    });
}